var a = getApp();

Page({
    data: {
        list: [],
        page: 1
    },
    onLoad: function(a) {
        this.initData(), this.getList();
    },
    initData: function() {
        this.setData({
            list: [],
            page: 1
        });
    },
    getList: function() {
        var t = this, e = a.getNetAddresss("plugin.case-library.api.mobile.home.special-list");
        a._postNetWork({
            url: e,
            success: function(a) {
                var e = a.data;
                1 == e.result ? (t.data.list = [], t.setData({
                    list: e.data.special.data,
                    current_page: e.data.special.current_page,
                    last_page: e.data.special.last_page
                })) : wx.showToast({
                    title: e.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    getMoreData: function() {
        var t = this, e = a.getNetAddresss("plugin.case-library.api.mobile.home.special-list");
        a._postNetWork({
            url: e,
            data: {
                page: t.data.page
            },
            success: function(a) {
                var e = a.data;
                if (1 == e.result) {
                    var s = e.data.special.data;
                    t.setData({
                        list: t.data.list.concat(s),
                        current_page: e.data.special.current_page,
                        last_page: e.data.special.last_page
                    });
                } else wx.showToast({
                    title: e.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (!(this.data.current_page >= this.data.last_page)) {
            var a = this.data.page + 1;
            this.setData({
                page: a
            }), this.getMoreData();
        }
    },
    onShareAppMessage: function() {}
});